package com.tianjs.observer;

import com.tianjs.observer.event.impl.WechatServer;
import com.tianjs.observer.listener.Observer;
import com.tianjs.observer.listener.impl.User;

/**
 * Hello world!
 */
public class App 
{
    public static void main( String[] args ){
    	WechatServer server = new WechatServer();
    	Observer userZhang = new User("ZhangSan");
        Observer userLi = new User("LiSi");
        Observer userWang = new User("WangWu");
        
        server.registerObserver(userZhang);
        server.registerObserver(userLi);
        server.registerObserver(userWang);
        server.setInfomation("PHP是世界上最好用的语言！");//发布事件
        
        System.out.println("----------------------------------------------");
        server.removeObserver(userZhang);
        server.setInfomation("JAVA是世界上最好用的语言！");
    }
}
